package flst.ipiweb.service;

import java.util.List;

import flst.ipiweb.persistance.dao.DAOFactory;
import flst.ipiweb.transverse.IPIException;
import flst.ipiweb.transverse.ModeDeLivraison;
import flst.ipiweb.transverse.Relai;

public class ServiceLivraison {
	
	public void updateModeDeLivraison(ModeDeLivraison modeDeLivraison) throws IPIException{
		DAOFactory.getInstance().getModeDeLivraisonDao().updateModeDeLivraison(modeDeLivraison);
	}

	public List<ModeDeLivraison> listerModeDeLivraison() throws IPIException{
		return DAOFactory.getInstance().getModeDeLivraisonDao().listerModeDeLivraison();
	}
	
	public void createRelai(Relai relai) throws IPIException{
		DAOFactory.getInstance().getRelaiDao().createRelai(relai);
	}

	public void updateRelai(Relai relai) throws IPIException{
	  DAOFactory.getInstance().getRelaiDao().updateRelai(relai);
	}

	public void deleteRelai(Relai relai) throws IPIException{
		DAOFactory.getInstance().getRelaiDao().deleteRelai(relai);
	}

	public List<Relai> listerRelai() throws IPIException{
		return DAOFactory.getInstance().getRelaiDao().listerRelai();
	}
	
	public List<Relai> listerRelaiByName() throws IPIException{
		return DAOFactory.getInstance().getRelaiDao().listerRelaiByName();
	}
	
	public List<Relai> listerRelaiByVille() throws IPIException{
		return DAOFactory.getInstance().getRelaiDao().listerRelaiByVille();
	}

	public int genererNumRelai() {
		return DAOFactory.getInstance().getRelaiDao().genererNumRelai();
	}

	public Relai getRelaiById(int idRelai) {
		return DAOFactory.getInstance().getRelaiDao().getRelaiById(idRelai);
	}

}
